package com.tarena.spring.test.config;

import com.tarena.spring.test.bean.Bean01;
import com.tarena.spring.test.bean.Bean04;
import com.tarena.spring.test.condition.OSCondition;
import com.tarena.spring.test.selector.MyImportSelector;
import org.springframework.context.annotation.*;

@Configuration
@ComponentScan(basePackages = {
        "com.tarena.spring.test.bean",
        "com.tarena.spring.test.conditional"})
//@Import(value = {Demo02Configuration.class})
@Import(value={MyImportSelector.class})
@PropertySource("jdbc.properties")
//@ConditionalOnWindows
public class Demo01Configuration {
    @Bean("bean01")
    public Bean01 bean01() {
        return new Bean01();
    }

    @Conditional({OSCondition.class})
    @Bean("bean04")
    public Bean04 bean04() {
        return new Bean04();
    }
}
